package view.WelcomePanels;

import controller.AccountController;
import dto.*;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import view.WelcomeFrame;
import view.WelcomePanels.SubPanels.MinimizeCloseButtonsPanel;

/**
 *
 * @author Joachim
 */
public abstract class AbstractWelcomePanel extends JPanel {
    
    protected WelcomeDTO dto;
    protected AccountController controller;
    protected WelcomeFrame frame;
    protected JPanel pnlWest, pnlCenter, pnlEast, pnlSouth;
    
    public AbstractWelcomePanel(WelcomeDTO dto, AccountController controller, WelcomeFrame frame) {
        this.dto = dto;
        this.controller = controller;
        this.frame = frame;
        initPanel();
        initComponents();
        addComponents();
    }
    
    private void initPanel() {
        this.setOpaque(false);
        this.setLayout(new BorderLayout());
        this.setBorder(new EmptyBorder(10,10,10,10));
    }
    
    protected abstract void initComponents();
    
    private void addComponents() {
        this.pnlEast = new MinimizeCloseButtonsPanel(frame);
        this.add(pnlWest, BorderLayout.WEST);
        this.add(pnlCenter, BorderLayout.CENTER);
        this.add(pnlEast, BorderLayout.EAST);
        this.add(pnlSouth, BorderLayout.SOUTH);
    }
}
